package com.lxk.ojbackendjudgeservice.controller.inner;


import com.lxk.ojbackendjudgeservice.judge.JudgeService;

import com.lxk.ojbackendmodel.model.entity.QuestionSubmit;

import com.lxk.ojbackendserviceclient.service.JudgeFeignClient;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 该服务仅内部调用，不是给前端的
 * 实际调用判题服务的不是这个，是通过mq消费端调用判题服务
 */
@RestController
@RequestMapping("/inner")
public class JudgeInnerController implements JudgeFeignClient {

    @Resource
    private JudgeService judgeService;

    /**
     * 判题
     * @param questionSubmitId
     * @return
     */
    @PostMapping("/do")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") long questionSubmitId){
        return judgeService.doJudge(questionSubmitId);
    }
}
